<template>
    <view class="page-wallet-withdraw-records">
		<view class="p-4" v-if="longList.list.length == 0">
            <u-empty text="暂无记录" mode="list"></u-empty>
    	</view>
		<u-cell-group v-else>
			<u-cell-item v-for="(item,index) in longList.list" :key="index" :label="item.createTime" :arrow="false">
				<template #title>
					<text class="unit">￥</text><text class="price">{{ item.amount }}</text>
				</template>
				<view>
					<u-icon name="clock-fill" size="36" v-if="item.status == 0" class="status-0"></u-icon>
					<u-icon name="checkmark-circle-fill" size="36" v-else-if="item.status == 1" class="status-1"></u-icon>
					<u-icon name="close-circle-fill" size="36" v-else class="status-2"></u-icon>
					<view :class="'status-' + item.status">{{ proxy.$util.setName(item.status, optionData.withdrawalStatus) }}</view>
				</view>
			</u-cell-item>
		</u-cell-group>
    </view>
</template>
<script setup lang="ts">
import {onShow, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
import { useLonglist } from '@/static/fn/longList';
const {proxy} = getCurrentInstance() as ComponentInternalInstance;
import { useOptionData } from '@/stores/optionData';
const optionDataStore = useOptionData();

const initObj = {
	listApi:'/admin/withdrawal/xcxPage',
}
let { searchForm, longList, getList} = useLonglist(initObj);
const optionData = reactive({});
const getInitData = async () => {
  optionData.withdrawalStatus = await optionDataStore.getDictList('withdrawal_status');
}
onPullDownRefresh(() => {
	getList('refresh');
	setTimeout( () => {
		uni.stopPullDownRefresh();
	}, 1000);
});
onReachBottom(() =>{
	getList();
});
onShow(() => {
	getInitData();
	getList('refresh');
})
</script>